const directives = require.context('./', false, /\.js$/)

export default {
  install: (app) => {
    for (let directive of directives.keys()) {
      const module = directives(directive)
      if (module.default) {
        const { name } = module.default
        if (name) app.directive(name, module.default)
      }
    }
  },
}
